/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FConfigDev.java
 *
 * Created on Feb 21, 2012, 10:21:29 AM
 */
package ru.apertum.diasled.forms;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import javax.imageio.ImageIO;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.WindowConstants;
import ru.apertum.diasled.common.Params;
import ru.apertum.diasled.common.exeptions.ClientException;
import ru.apertum.diasled.cfg.Configuration;
import ru.apertum.diasled.rxtx.PortUtil;

/**
 *
 * @author Evgeniy Egorov
 */
public class FConfigDev extends javax.swing.JDialog {

    /** Creates new form FConfigDev */
    private FConfigDev(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();

        setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
        // свернем по esc
        getRootPane().registerKeyboardAction(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        },
                KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                JComponent.WHEN_IN_FOCUSED_WINDOW);
        try {
            setIconImage(ImageIO.read(DiasledView.class.getResource("/ru/apertum/diasled/forms/resources/favicon.png")));
        } catch (IOException ex) {
            System.err.println(ex);
        }


    }

    public static FConfigDev getInstance() {
        FConfigDevHolder.INSTANCE.setLocationRelativeTo(null);
        return FConfigDevHolder.INSTANCE;
    }

    private static class FConfigDevHolder {

        private static final FConfigDev INSTANCE = new FConfigDev(null, true);
    }

    public void load() {
        final int pos;
        switch (Params.getInstance().getPortSpeed()) {
            case 9600:
                pos = 0;
                break;
            case 14400:
                pos = 1;
                break;
            case 19200:
                pos = 2;
                break;
            case 38400:
                pos = 3;
                break;
            case 57600:
                pos = 4;
                break;
            case 115200:
                pos = 5;
                break;
            case 128000:
                pos = 6;
                break;
            case 921600:
                pos = 7;
                break;
            default:
                pos = 7;
        }
        comboBoxSpeed.setSelectedIndex(pos);
        comboBoxDataBits.setSelectedIndex(Params.getInstance().getPortDatabits() - 4);
        comboBoxStopBit.setSelectedIndex(Params.getInstance().getPortStopbits() == 1 ? 0 : 1);
        checkBoxParity.setSelected(Params.getInstance().getPortParity() == 1);
        labelFindDev.setForeground(new Color(0, 0, 0));
        labelFindDev.setText("Устройство сканирования не определялось");
        textAreaDetermDev.setText("");
    }

    public void save() {
        Params.getInstance().setPortSpeed(Integer.parseInt((String) comboBoxSpeed.getSelectedItem()));
        Params.getInstance().setPortDatabits(Integer.parseInt((String) comboBoxDataBits.getSelectedItem()));
        Params.getInstance().setPortStopbits(Integer.parseInt((String) comboBoxStopBit.getSelectedItem()));
        Params.getInstance().setPortParity(checkBoxParity.isSelected() ? 1 : 0);
        Params.getInstance().save();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        buttonSave = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        comboBoxSpeed = new javax.swing.JComboBox();
        comboBoxDataBits = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        checkBoxParity = new javax.swing.JCheckBox();
        comboBoxStopBit = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        listPorts = new javax.swing.JList();
        buttonRefreshPorts = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        buttonFindDev = new javax.swing.JButton();
        labelFindDev = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        buttonDetermDev = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        textAreaDetermDev = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(ru.apertum.diasled.Diasled.class).getContext().getResourceMap(FConfigDev.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(new javax.swing.border.MatteBorder(null));
        jPanel1.setName("jPanel1"); // NOI18N

        buttonSave.setText(resourceMap.getString("buttonSave.text")); // NOI18N
        buttonSave.setName("buttonSave"); // NOI18N
        buttonSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSaveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(471, Short.MAX_VALUE)
                .addComponent(buttonSave)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(buttonSave)
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        comboBoxSpeed.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "9600", "14400", "19200", "38400", "57600", "115200", "128000", "921600" }));
        comboBoxSpeed.setSelectedIndex(7);
        comboBoxSpeed.setName("comboBoxSpeed"); // NOI18N

        comboBoxDataBits.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "4", "5", "6", "7", "8" }));
        comboBoxDataBits.setSelectedIndex(4);
        comboBoxDataBits.setName("comboBoxDataBits"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        checkBoxParity.setText(resourceMap.getString("checkBoxParity.text")); // NOI18N
        checkBoxParity.setName("checkBoxParity"); // NOI18N

        comboBoxStopBit.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2" }));
        comboBoxStopBit.setName("comboBoxStopBit"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(comboBoxDataBits, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(comboBoxSpeed, 0, 101, Short.MAX_VALUE)
                            .addComponent(checkBoxParity)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(comboBoxStopBit, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(comboBoxSpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboBoxDataBits, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(checkBoxParity)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(comboBoxStopBit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jScrollPane1.border.title"))); // NOI18N
        jScrollPane1.setName("jScrollPane1"); // NOI18N

        listPorts.setName("listPorts"); // NOI18N
        jScrollPane1.setViewportView(listPorts);

        buttonRefreshPorts.setText(resourceMap.getString("buttonRefreshPorts.text")); // NOI18N
        buttonRefreshPorts.setName("buttonRefreshPorts"); // NOI18N
        buttonRefreshPorts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonRefreshPortsActionPerformed(evt);
            }
        });

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        buttonFindDev.setText(resourceMap.getString("buttonFindDev.text")); // NOI18N
        buttonFindDev.setName("buttonFindDev"); // NOI18N
        buttonFindDev.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonFindDevActionPerformed(evt);
            }
        });

        labelFindDev.setText(resourceMap.getString("labelFindDev.text")); // NOI18N
        labelFindDev.setName("labelFindDev"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonFindDev)
                .addGap(18, 18, 18)
                .addComponent(labelFindDev)
                .addContainerGap(247, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonFindDev)
                    .addComponent(labelFindDev))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        buttonDetermDev.setText(resourceMap.getString("buttonDetermDev.text")); // NOI18N
        buttonDetermDev.setName("buttonDetermDev"); // NOI18N
        buttonDetermDev.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonDetermDevActionPerformed(evt);
            }
        });

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        textAreaDetermDev.setColumns(20);
        textAreaDetermDev.setFont(resourceMap.getFont("textAreaDetermDev.font")); // NOI18N
        textAreaDetermDev.setRows(5);
        textAreaDetermDev.setName("textAreaDetermDev"); // NOI18N
        jScrollPane2.setViewportView(textAreaDetermDev);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonDetermDev)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(buttonDetermDev))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE)
                    .addComponent(buttonRefreshPorts, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonRefreshPorts)))
                .addGap(18, 18, 18)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
        save();
        JOptionPane.showMessageDialog(this,
                "Параметры сохранены успешно.",
                "Сохранение параметров",
                JOptionPane.PLAIN_MESSAGE);
    }//GEN-LAST:event_buttonSaveActionPerformed

    private void buttonRefreshPortsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRefreshPortsActionPerformed
        textAreaDetermDev.setText("Определяем порты...   ");
        listPorts.setModel(new DefaultComboBoxModel(PortUtil.findPorts().toArray(new String[0])));
        portName = null;
        textAreaDetermDev.append("OK\n");
    }//GEN-LAST:event_buttonRefreshPortsActionPerformed

    private void buttonFindDevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonFindDevActionPerformed
        portName = null;
        buttonRefreshPortsActionPerformed(null);
        textAreaDetermDev.append("Определение устройства...   ");
        if (listPorts.getModel().getSize() == 0) {
            JOptionPane.showMessageDialog(this,
                    "Устройство не может быть найдено так как нет ни одного СОМ-порта на компьютере или их не удалось определить.",
                    "Поиск устройства",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }

        portName = PortUtil.findDevice();
        if (portName == null) {
            labelFindDev.setForeground(new Color(255, 0, 0));
            labelFindDev.setText("Устройство сканирования не найдено");
            textAreaDetermDev.append("FAIL\n");
        } else {
            labelFindDev.setForeground(new Color(0, 150, 0));
            labelFindDev.setText("Устройство найдено. Задействован порт " + portName);
            textAreaDetermDev.append("OK\n");
        }
    }//GEN-LAST:event_buttonFindDevActionPerformed
    private String portName = null;
    private void buttonDetermDevActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDetermDevActionPerformed
        buttonFindDevActionPerformed(null);
        if (portName == null) {
            JOptionPane.showMessageDialog(this,
                    "Устройство не может быть опознанно так как оно не найдено.",
                    "Поиск устройства",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }
        textAreaDetermDev.append("Определяем устройство...   ");
        byte[] request = new byte[1];
        request[0] = (byte) 0x10;
        final byte[] res;
        try {
            res = PortUtil.sendDataInPort(portName, request);
        } catch (Exception ex) {
            textAreaDetermDev.append("FAIL\n");
            throw new ClientException("Не получилось опросить устройство.", ex);
        }
        final ByteBuffer bb = ByteBuffer.allocate(2);
        bb.order(ByteOrder.BIG_ENDIAN);
        bb.put(res[1]);
        bb.put(res[0]);
        final short shortVal = bb.getShort(0);
        textAreaDetermDev.append("OK  " + shortVal + "\n");
        textAreaDetermDev.append("Поиск конфигурационного файла... ");



        final String[] files = new File("config").list(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {
                return name.endsWith("" + shortVal + ".vit") || name.endsWith("" + shortVal + ".VIT");
            }
        });
        if (files.length == 0) {
            textAreaDetermDev.append("FAIL\n");
            JOptionPane.showMessageDialog(this,
                    "Конфигурационный файл на найден для этого устройства.",
                    "Поиск устройства",
                    JOptionPane.WARNING_MESSAGE);
            return;
        }
        textAreaDetermDev.append("OK  " + files[0] + "\n");
        textAreaDetermDev.append("Чтение конфигурационного файла... ");
        final Configuration cfg = Configuration.load(new File("config/" + files[0]));
        textAreaDetermDev.append("OK  " + cfg.getSystemName() + "\n");
        
        textAreaDetermDev.append("Количество сенсоров:  " + cfg.getSensors().size() + "\n");
        textAreaDetermDev.append("Количество контуров:  " + cfg.getOutlines().size() + "\n");
        textAreaDetermDev.append("Коэффициент преобразования веса:  " + cfg.getWeightConversionCoeff() + "\n");
        textAreaDetermDev.append("\nOK");
    }//GEN-LAST:event_buttonDetermDevActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonDetermDev;
    private javax.swing.JButton buttonFindDev;
    private javax.swing.JButton buttonRefreshPorts;
    private javax.swing.JButton buttonSave;
    private javax.swing.JCheckBox checkBoxParity;
    private javax.swing.JComboBox comboBoxDataBits;
    private javax.swing.JComboBox comboBoxSpeed;
    private javax.swing.JComboBox comboBoxStopBit;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel labelFindDev;
    private javax.swing.JList listPorts;
    private javax.swing.JTextArea textAreaDetermDev;
    // End of variables declaration//GEN-END:variables
}
